<template>
  <div>
    <p>本场得分：{{ msg }}</p>
    <button @click="add">加分</button>
    <button @click="sub">减分</button>
    <button @click="three">三分球</button>
    自定义得分：<input @keyup.enter="sum" type="text" v-model.number="msg1" >
  </div>
</template>
<script>
export default{
   data(){
    return{
      msg:'0',
      msg1:0
    }
},
methods:{
  add(){
    +this.msg++
  },
  sub(){
    +this.msg--
  },
  three(){
    this.msg=Number(this.msg)+3
  },
  sum(){
     this.msg=Number(this.msg)+Number(this.msg1)
  }
}
}

</script>
<style lang="scss" scoped>

</style>
